home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard.def;
-
- public class DefConnection extends DefAbstract {
- public static final int DBTYPE_INVALID = -1;
- public static final int DBTYPE_ODBC_MSACCESS = 0;
- public static final int DBTYPE_ODBC_MSSQLSERVER = 1;
- public static final int DBTYPE_ODBC_OTHER = 2;
- private int _odbcType;
- private String _dsnName;
- private String _userName;
- private String _password;
- private int _globalConnection;
-
- public DefConnection() {
- }
-
- public DefConnection(DefConnection aDefConnection) {
- this.setEqualConnectionTo(aDefConnection);
- this._globalConnection = aDefConnection._globalConnection;
- }
-
- public void setEqualConnectionTo(DefConnection aDefConnection) {
- this._odbcType = aDefConnection._odbcType;
- this._dsnName = aDefConnection._dsnName;
- this._userName = aDefConnection._userName;
- this._password = aDefConnection._password;
- }
-
- public void setOdbcType(int odbcType) {
- switch (odbcType) {
- case 0:
- case 1:
- this._odbcType = odbcType;
- break;
- default:
- this._odbcType = -1;
- }
-
- }
-
- public void setDSNName(String dSN) {
- this._dsnName = new String(dSN);
- }
-
- public void setUserName(String userName) {
- this._userName = new String(userName);
- }
-
- public void setPassword(String password) {
- this._password = new String(password);
- }
-
- public void setGlobalConnection(int globalConnection) {
- this._globalConnection = globalConnection;
- }
-
- public int getOdbcType() {
- return this._odbcType;
- }
-
- public String getDSNName() {
- return this._dsnName;
- }
-
- public String getUserName() {
- return this._userName;
- }
-
- public String getPassword() {
- return this._password;
- }
-
- public int getGlobalConnection() {
- return this._globalConnection;
- }
-
- public String getBaseName() {
- return "MSDBConnection";
- }
-
- public boolean equalConnectionTo(DefConnection otherConnection) {
- return this._odbcType == otherConnection.getOdbcType() && this._dsnName.equals(otherConnection.getDSNName()) && this._userName.equals(otherConnection.getUserName()) && this._password.equals(otherConnection.getPassword());
- }
- }
-